package com.xhwl.centiotdata.service.cent;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhwl.common.dto.cent.sdata.AccountDTO;
import com.xhwl.common.dto.cent.sdata.GroupDTO;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.Account;
import com.xhwl.common.pojo.cent.sdata.Organization;
import com.xhwl.common.pojo.cent.sdata.Role;
import com.xhwl.common.pojo.cent.sdata.personnel.StaffDTO;
import com.xhwl.common.query.cent.sdata.*;
import feign.Param;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;
import java.util.Map;

@FeignClient(value = "cent-data-core")
public interface IAccountCentService {

    @RequestLine(value = "POST /account-service/view-list")
    List<AccountDTO> getList(@Param("accountQuery") AccountQuery accountQuery);

    @RequestLine(value = "POST /account-service/get-one")
    Account getAccount(@Param("operateAccount") Account operateAccount, @Param("accountQuery") AccountQuery accountQuery);

    @RequestLine(value = "POST /account-service/get-by-id")
    Account findById(@Param("id") Integer id);

    @RequestLine(value = "POST /account-service/edit-account-info")
    ResultJson editAccountInfo(@Param("account") Account account);
    /**
     * 动态获取 角色list 不分页
     *
     * @param operateAccount
     * @param roleQuery
     * @return
     */
    @RequestLine(value = "POST /role-service/get-roleList")
    List<Role> getRoleList(@Param(value = "operateAccount") Account operateAccount, @Param("roleQuery") RoleQuery roleQuery);
    /**
     * 新增员工信息
     * @param staffDTO 员工实体
     * @param operator 操作人
     * @return
     */
    @RequestLine(value = "POST /staff-service/create")
    ResultJson create(@Param("staffDTO")StaffDTO staffDTO, @Param("operator")Account operator);

    /**
     * 员工详情
     */
    @RequestLine(value = "POST /staff-service/detail")
    StaffDTO detail(@Param("id")Integer id,@Param("enterpriseId") Integer enterpriseId,@Param("accountId") Integer accountId);
    /**
     * 单个员工
     */
    @RequestLine(value = "POST /staff-service/one")
    StaffDTO one(@Param("staffQuery") StaffQuery staffQuery);

    /**
     * 仅为奥莱主数据更新员工信息使用
     * @param account
     * @return
     */
    @RequestLine(value = "POST /account-service/updateAccountById")
    void updateByAccountID(@Param("account")Account account);

    @RequestLine(value = "POST /staff-service/page/V2")
    Page<StaffDTO> pageV2(@Param("staffQuery") StaffQuery staffQuery, @Param("page") Page page);

    /**
     * 查询用户组
     * @param groupQuery
     * @return
     */
    @RequestLine(value = "POST /group-service/list")
    List<GroupDTO> getList(@Param("groupQuery") GroupQuery groupQuery);

    /**
     * 根据房间查找楼栋
     */
    @RequestLine(value = "POST /organization-service/get-parent")
    Map<Integer,List<Organization>> getParent(@Param("query") OrganizationQuery query);
}
